﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<kysec.RAL.EFToMySql.tb_product>>" %>
<%@ Import Namespace="kysec.RAL.EFToMySql" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc"%>
<%string type = Request.QueryString["type"].ToString(); if (Model.Count == 0)
   {%>
    <span style="text-align:center; color:Red; font-size:16px;">没有任何产品信息，请添加信息……</span><a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Product/AddProducts?type=<%:type %>" style="color:Green; margin-left:20px;">新增产品</a>
<%}else{ %>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"  onmouseout="changeback()">
  <tr>
    <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">名称</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">型号</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">特点</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">功能</span></div></td>
    <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">描述</span></div></td>
     <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10" title="点击查看">图片</span></div></td>
    <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">发布时间</span></div></td>
    <td width="12%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">是否为样品</span></div></td>
    <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">当前状态</span></div></td>
    <td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">操作</span></div></td>
  </tr>
    <% foreach (kysec.RAL.EFToMySql.tb_product item in Model)
       {
           XElement imgPath = XElement.Parse(item.c_x_imgPath);
           %>
  <tr>
    <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19" title="<%=Html.Encode(item.c_vc_name)%>"><%= Html.Encode(item.c_vc_name) %></span><input type="hidden" id="newId" value="<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString()) %>" /></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE19" title="<%=Html.Encode(item.c_vc_pModel) %>"><%= Html.Encode(item.c_vc_pModel)%></span></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE19" title="<%=Html.Encode(item.c_ntx_pFeatures) %>">特点显示</span></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE19" title="<%=Html.Encode(item.c_vc_pFunction) %>">功能显示</span></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE19" title="<%=Html.Encode(item.c_ntx_summary) %>">描述信息</span></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE19" title="<%if(imgPath.HasElements) {  %><%=imgPath.Element("item").Attribute("url").ToString() %><%}else{ %>此产品没有图片<%} %>">图片路径</span></div></td>    
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"> <%= Html.Encode(item.c_dt_sendTime.ToShortDateString()) %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center" title="点击可以转换"><%if (!item.c_b_isDelete)
                                                                                           {
                                                                                               if (bool.Parse(Html.Encode(item.c_b_isDemo).ToString()))
                                                                                               {%><a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Product/setDemo?id=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString())%>&isDemo=0&type=<%=item.c_i_type %>" title="点击设置为产品展示"> 样品演示</a><%}
                                                                                               else
                                                                                               {%><a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Product/AddDemo?id=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString())%>&type=<%=item.c_i_type %>" title="点击设置为样品演示"> 产品展示</a><%}
                                                                                           }
                                                                                           else
                                                                                           { %>此产品已删除<%} %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if (bool.Parse(Html.Encode(item.c_b_isDelete).ToString())){%> 已删除<%} else{%>未删除<%} %></div></td>
    <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><%if(!item.c_b_isDelete){ %><span class="del"><a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Product/UpdateProduct?id=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString())  %>&type=<%=item.c_i_type %>&isUpdate=true" target="main">修改</a> &nbsp;|&nbsp;<a href="<%:kysec.CR.MyUrl.WebData.WEBURL  %>/Product/UpdateProduct?id=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString())  %>&type=<%:item.c_i_type %>&isUpdate=false" target="main">查看</a>&nbsp;|&nbsp;<a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/Product/Delete?id=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString())  %>&type=<%=item.c_i_type %>">删除</a></span><%}else{ %><span class="restore"><a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/Product/Delete?id=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_pId).ToString())  %>&type=<%=item.c_i_type %>" >恢复</a></span><%} %></div></td>
  </tr> 
  <%} %>
</table><%} %>
<%=Html.AjaxPager(Model, new PagerOptions() { CssClass = "mvcPager", PageIndexParameterName = "id", ShowMorePagerItems = false, AlwaysShowFirstLastPageNumber = true, ShowPageIndexBox = true, PageIndexBoxWrapperFormatString = "页{0}" }, new AjaxOptions() { UpdateTargetId = "page" })%>
